package sample.plugin.language.python.decision;

import static sample.plugin.language.python.PythonToken.*;

import com.rapid.api.lang.engine.highlight.decision.DecisionResult;
import com.rapid.api.lang.engine.highlight.token.TokenModel;

import io.github.rosemoe.sora.widget.schemes.EditorColorScheme;
import sample.plugin.language.base.AbstractDecision;
import sample.plugin.language.python.PythonState;

public class PythonBasicDecision extends AbstractDecision<PythonState> {
    @Override
    public Iterable<DecisionResult> decide(TokenModel model, PythonState state) {
        switch (model.token) {
            case FALSE:
            case NONE:
            case TRUE:
            case AND:
            case AS:
            case ASSERT:
            case BREAK:
            case CLASS:
            case CONTINUE:
            case DEF:
            case DEL:
            case ELIF:
            case ELSE:
            case EXCEPT:
            case FINALLY:
            case FOR:
            case FROM:
            case GLOBAL:
            case IF:
            case IMPORT:
            case IN:
            case IS:
            case LAMBDA:
            case NONLOCAL:
            case NOT:
            case OR:
            case PASS:
            case RAISE:
            case RETURN:
            case TRY:
            case WHILE:
            case WITH:
            case YIELD:
                return singleColorBold(EditorColorScheme.KEYWORD);
            case LPAREN:
            case RPAREN:
            case LBRACE:
            case RBRACE:
            case LBRACK:
            case RBRACK:
            case SEMICOLON:
            case COMMA:
            case DOT:
            case TAB:
            case EQ:
            case GT:
            case LT:
            case COMP:
            case COLON:
            case EQEQ:
            case LTEQ:
            case GTEQ:
            case NOTEQ:
            case PLUS:
            case MINUS:
            case MULT:
            case MULTMULT:
            case DIV:
            case DIVDIV:
            case XOR:
            case MOD:
            case LSHIFT:
            case RSHIFT:
            case PLUSEQ:
            case MINUSEQ:
            case MULTEQ:
            case MULTMULTEQ:
            case DIVEQ:
            case DIVDIVEQ:
            case ANDEQ:
            case OREQ:
            case XOREQ:
            case MODEQ:
                return singleColor(EditorColorScheme.OPERATOR);
            case CHARACTER_LITERAL:
            case INTEGER_LITERAL:
            case FLOATING_POINT_LITERAL:
                return singleColor(EditorColorScheme.LITERAL);
            case COMMENT:
                return singleColorItalic(EditorColorScheme.COMMENT);
            case STRING:
            case SINGLE_LONG_STRING:
            case DOUBLE_LONG_STRING:
                return singleColor(EditorColorScheme.STRING);
        }
        return refuse();
    }
}
